{$CLEO .cs}
{$USE cleo+}
{$USE ini} 
0000: nop
03A4: script_name 'WZOOMUL'
wait 0
wait 0

0@ = 0

if
    0AA2: 31@ = load_dynamic_library "CLEO+.cleo"
jf @ILoveMyGirlfriendJessica
if
    0AA4: 30@ = get_dynamic_library_procedure "GetCleoPlusVersion" library 31@
then
    0AA7: call_function_return 30@ num_params 0 pop 0 29@
end
0AA3: free_dynamic_library 31@
if
    29@ >= 0x1020000
jf @ILoveMyGirlfriendJessica

if
    0E20: is_on_samp
then
    31@ = 0
    0AF0: 31@ = read_int_from_ini_file "cleo\Weapon Zoom Unlimited.ini" section "MAIN" key "DisableOnSAMP"
    if
        31@ > 0
    then
        0A93: terminate_this_custom_script
    end
end

:Initialization
0@ = 1

if
    0AAB: does_file_exist "cleo\DrivebySettings.ini"
jf @ILoveMyGirlfriendJessica

0AC6: get_label_pointer 16@ = label @Buffer

20@ = 16
0AC7: get_var_pointer 21@ = var 24@

for 30@ = 0 to 255 step 1   //iterate through possible weapon ID's
    if
        20@ == 16
    then
        wait 0  //wait after 16 ini reads to reduce overheat
        20@ = 0
    end
    20@ += 1
    
    0AD3: 22@s = string_format '%d' 30@

    :ReadWeaponSettings
    24@ = -2.0
    25@ = -2.0
    26@ = -2.0
    27@ = -2.0
        
    31@ = 0
    0AC8: 31@ = allocate_memory size 256        
    if
        0AF4: 31@ = read_string_from_ini_file "cleo\Weapon Zoom Unlimited.ini" section "WEAPONCONFIG" key 22@s
    then
        0AD4: 32@ = scan_string 31@ format "%f / %f / %f / %f" 24@ 25@ 26@ 27@            
    end
    0AC9: free_memory 31@
    
    0A90: int_mul 23@ = 30@ * 0x10  //offset for storing the values by weapon ID
    
    for 29@ = 0x00 to 0x0C step 0x04
        0D4E: 28@ = read_struct_offset 21@ offset 29@ size 4    //read content of 24@ 25@ 26@ 27@
        if
            28@ > -2.0
        then     
            0EF4: clamp_float 28@ min 0.0 max 70.0 store_to 28@
        end
        0A8E: int_add 22@ = 23@ + 29@
        0E28: write_struct_offset 16@ offset 22@ size 4 value 28@   //write content into buffer
    end
end
if
    30@ == 256
then
    22@s = 'Default'
    jump @ReadWeaponSettings
end

21@ = -1
22@ = -1
23@ = -1
24@ = -1
10@ = 0

31@ = 0
0AF0: 31@ = read_int_from_ini_file "cleo\Weapon Zoom Unlimited.ini" section "SETTINGS" key "UseL2R2"
if
    31@ < 1
then    
    08BD: set_local_var_bit_const 10@ bit 0
end
31@ = 0
0AF0: 31@ = read_int_from_ini_file "cleo\Weapon Zoom Unlimited.ini" section "SETTINGS" key "Invertation"
if
    31@ > 0
then    
    08BD: set_local_var_bit_const 10@ bit 1
end
0AF0: 4@ = read_int_from_ini_file "cleo\Weapon Zoom Unlimited.ini" section "SETTINGS" key "EnableInCar"
0AF0: 5@ = read_int_from_ini_file "cleo\Weapon Zoom Unlimited.ini" section "SETTINGS" key "EnableOnFoot"
0AF2: 6@ = read_float_from_ini_file "cleo\Weapon Zoom Unlimited.ini" section "WEAPONCONFIG" key "ExtraCrouchZoom"
if 6@ == 1.0
then 6@ = 0.0
end
if 6@ > 2.0
then 6@ = 2.0
end
0AF0: 21@ = read_int_from_ini_file "cleo\Weapon Zoom Unlimited.ini" section "SETTINGS" key "OnOffKey"
0AF0: 22@ = read_int_from_ini_file "cleo\Weapon Zoom Unlimited.ini" section "SETTINGS" key "ResetKey"
0AF0: 23@ = read_int_from_ini_file "cleo\Weapon Zoom Unlimited.ini" section "SETTINGS" key "OnOffButton"
0AF0: 24@ = read_int_from_ini_file "cleo\Weapon Zoom Unlimited.ini" section "SETTINGS" key "ResetButton"
0AF0: 19@ = read_int_from_ini_file "cleo\Weapon Zoom Unlimited.ini" section "SETTINGS" key "PrintHelp"
12@ = -1.0
0AF0: 31@ = read_int_from_ini_file "cleo\Weapon Zoom Unlimited.ini" section "WEAPONCONFIG" key "SmoothSniperAndRPG"
if 31@ > 0
then 12@ = 0.0
end
31@ = 0

08BD: set_local_var_bit_const 10@ bit 8

if
    33@ >= 424242
then
    0AD1: print_formatted_now "Reloading completed." time 2000
else
    wait 6000
end

0AAA: 28@ = get_script_struct_named "MANDRBY"
if and
    4@ > 0
    28@ > 0
then
    0D2F: 31@ = get_script_var 28@ index 1
    if
        88B7: not is_local_var_bit_set_const 31@ bit 8
    then
        0AD1: print_formatted_now "Weapon Zoom Unlimited: Please update to the latest version of Manual Driveby Refixed for full compatibility with driveby zoom." time 8000
    end
end
    
0@ = 0
3@ = 0.0
7@ = -2
8@ = -2
9@ = -2
TIMERA = 0
TIMERB = 0


:Main
while true
    if
        0@ == 0
    then
        wait 200
    else
        wait 0
    end
    
    0801: get_camera_fov 1@
    
    if and
        0256: is_player_playing $PLAYER_CHAR
        8EB7: not is_on_scripted_cutscene
        1@ <> 100.0
        80E1: not is_button_pressed pad 0 button 12
    jf @ResetEverything
    
    if
        0ADC: test_cheat "MYNAMEISWEBB"
    then
        if
            88B7: not is_local_var_bit_set_const 10@ bit 6
        then
            08BD: set_local_var_bit_const 10@ bit 6
            03E5: print_help 'CHEAT1'
        else
            08C3: clear_local_var_bit_const 10@ bit 6
            03E5: print_help 'CHEAT8'
        end
        gosub @ConditionCheck
        if
            0025: is_float_lvar_greater_than_float_lvar 27@ > 1@
        then
            0922: camera_set_lerp_fov 1@ to 27@ timelimit 400 smooth_transition 1
            0931: camera_persist_fov 1
        end
    end
    if and
        3@ > 0.0
        8045: not is_float_lvar_equal_to_float_lvar 1@ <> 3@
    then
        if or
            8E3E: not is_button_just_pressed pad 0 button 13
            0E42: is_char_doing_task_id $PLAYER_ACTOR task_id 1022  //driveby
        jf @ResetFOV            
        if
            0A4B: is_pc_using_joypad
        then
            if
                8E3E: not is_button_just_pressed pad 0 button 24@
            jf @ResetFOV
        else
            if
                0E3D: is_key_just_pressed 22@
            then  
                :ResetFOV                
                0922: camera_set_lerp_fov 1@ to 3@ timelimit 400 smooth_transition 1
                0931: camera_persist_fov 0
                03E5: print_help 'CHEAT2'
                wait 0
                if and
                    19@ > 1
                    08B7: is_local_var_bit_set_const 10@ bit 2
                    868C: not is_player_targetting_anything $PLAYER_CHAR
                then 
                    gosub @PrintMessage
                else
                    03E6: clear_help
                end
                jump @Main
            end
        end
    end
    
    // In car
    if and
        4@ > 0
        0E42: is_char_doing_task_id $PLAYER_ACTOR task_id 1022  //driveby
    then
        if
            0@ == 0
        then
            gosub @ConditionCheck
        else
            0470: 31@ = get_current_char_weapon $PLAYER_ACTOR
            if
                803B: not is_int_lvar_equal_to_int_lvar 31@ <> 30@
            then
                gosub @ConditionCheck
                if
                    0@ == -1
                then
                    gosub @ResetApply
                    0@ = -1
                    jump @Main
                end
                if
                    0025: is_float_lvar_greater_than_float_lvar 27@ > 1@
                then
                    0922: camera_set_lerp_fov 1@ to 27@ timelimit 400 smooth_transition 1
                    0931: camera_persist_fov 1
                end
            end                    
        end
                   
        if
            0@ <> -1
        jf @Main
        
        if
            4@ > 1
        then
            gosub @ActivationCheck
            if
                0@ > 0
            jf @Main
        end
        
        if
            0A4B: is_pc_using_joypad
        then
            if
                9@ == -2
            then
                9@ = 0
                0AAA: 28@ = get_script_struct_named "MANDRBY"
                if
                    28@ > 0
                then   
                    if
                        88B7: not is_local_var_bit_set_const 10@ bit 0
                    then
                        0D2F: 31@ = get_script_var 28@ index 3
                        if
                            31@ > 2
                        then
                            08BD: set_local_var_bit_const 10@ bit 0
                            08BD: set_local_var_bit_const 10@ bit 7
                        end
                    end
                    
                    0D2F: 9@ = get_script_var 28@ index 6
                    if
                        9@ > 0
                    then
                        if
                            9@ == 1
                        then
                            if or
                                23@ == 10
                                24@ == 10
                                23@ == 11
                                24@ == 11
                            jf @LenFaki
                        else
                            if or
                                23@ == 8
                                24@ == 8
                                23@ == 9
                                24@ == 9
                                08B7: is_local_var_bit_set_const 10@ bit 0
                            jf @LenFaki
                        end    
                        0D2E: set_script_var 28@ index 6 value 0
                    end
                end
            end                    
        
            :LenFaki
            if
                88B7: not is_local_var_bit_set_const 10@ bit 0
            then
                if
                    8@ == -2
                then
                    8@ = 0
                    if
                        28@ > 0
                    then
                        0D2F: 8@ = get_script_var 28@ index 8
                        if
                            8@ > 0
                        then
                            0D2E: set_script_var 28@ index 8 value 0
                        end
                    end
                end
                
                if
                    00E1: is_button_pressed pad 0 button 5      // ~k~~VEHICLE_LOOKLEFT~
                then                   
                    0A8C: write_memory 0xB73466 size 2 value 0xFF virtual_protect 0    //LookRight pressed
                    jump @ZoomIn
                end
                if
                    00E1: is_button_pressed pad 0 button 7      // ~k~~VEHICLE_LOOKRIGHT~
                jf @Main
                0A8C: write_memory 0xB73462 size 2 value 0xFF virtual_protect 0    //LookLeft pressed
                jump @ZoomOut
            end
        end
        
        if
            7@ == -2
        then
            7@ = 0
            0AAA: 28@ = get_script_struct_named "MANDRBY"
            if
                28@ > 0
            then
                0D2F: 7@ = get_script_var 28@ index 7
                if
                    7@ > 0
                then
                    0D2E: set_script_var 28@ index 7 value 0
                end
            end
        end
        
        :NotUseL2R2   
        if and
            80E1: not is_button_pressed pad 0 button 8
            8E10: not is_mouse_wheel_up
        jf @ZoomIn
        if and
            80E1: not is_button_pressed pad 0 button 9
            8E11: not is_mouse_wheel_down
        jf @ZoomOut        
        jump @Main
    end
    
    // On Foot
    if and
        5@ > 0
        0E46: is_char_using_gun $PLAYER_ACTOR
        0E67: is_aim_button_pressed pad 0
    then
        if
            0597: is_char_ducking $PLAYER_ACTOR
        then
            if and
                0@ <> 0
                6@ > 0.0
            then
                if
                    88B7: not is_local_var_bit_set_const 10@ bit 4
                then
                    006B: mult_float_lvar_by_float_lvar 27@ *= 6@
                    08BD: set_local_var_bit_const 10@ bit 4
                else
                    if
                        8E3E: not is_button_just_pressed pad 0 button 18
                    jf @CrouchReset
                end
            end
        else
            :CrouchReset
            if  
                5@ < 3
            jf @ResetEverything            
            if  
                08B7: is_local_var_bit_set_const 10@ bit 4
            then
                0073: div_float_lvar_by_float_lvar 27@ /= 6@
                if
                    0025: is_float_lvar_greater_than_float_lvar 27@ > 1@
                then
                    0922: camera_set_lerp_fov 1@ to 27@ timelimit 200 smooth_transition 1
                    0931: camera_persist_fov 1
                end  
                08C3: clear_local_var_bit_const 10@ bit 4
            end
        end
        
        if
            0@ == 0
        then
            gosub @ConditionCheck
            if
                12@ > -1.0
            then
                0E64: get_current_camera_mode 11@
                if or
                    11@ == 7
                    11@ == 8
                    11@ == 51
                then 
                    0A8D: 12@ = read_memory 0xB6EC1C size 4 virtual_protect 0
                    0087: set_lvar_float_to_lvar_float 13@ = 1@
                    0ED8: set_script_event_on_menu 1 label @ResetOnMenu var_slot 14@
                end
            end                      
        end

        if
            0@ <> -1
        jf @Main
        
        if
            12@ > 0.0
        then
            if and
                8045: not is_float_lvar_equal_to_float_lvar 1@ <> 13@
                0025: is_float_lvar_greater_than_float_lvar 13@ > 1@
            then
                0087: set_lvar_float_to_lvar_float 31@ = 1@
                0073: div_float_lvar_by_float_lvar 31@ /= 13@                
                29@ = 2.0
                0063: sub_float_lvar_from_float_lvar 29@ -= 31@
                006B: mult_float_lvar_by_float_lvar 31@ *= 29@
                0087: set_lvar_float_to_lvar_float 29@ = 12@
                006B: mult_float_lvar_by_float_lvar 29@ *= 31@               
                0A8C: write_memory 0xB6EC1C size 4 value 29@ virtual_protect 0
            end
        end
                
        if or
            5@ == 2
            5@ > 3
        then
            gosub @ActivationCheck
            if
                0@ > 0
            jf @Main
        end
        
        if
            0A4B: is_pc_using_joypad
        then
            if
                068C: is_player_targetting_anything $PLAYER_CHAR
            then
                if
                    08B7: is_local_var_bit_set_const 10@ bit 2
                then
                    if or
                        0A2A: is_this_help_message_being_displayed 'SYN1_44'
                        0A2A: is_this_help_message_being_displayed 'CHEAT2'
                    then
                        03E6: clear_help
                    end
                end
                if
                    08B7: is_local_var_bit_set_const 10@ bit 5
                then
                    08C3: clear_local_var_bit_const 10@ bit 5
                end
                jump @Main
            end
            if
                88B7: not is_local_var_bit_set_const 10@ bit 0
            jf @NotUseL2R2 
        end
        
        if or
            00E1: is_button_pressed pad 0 button 5
            0E10: is_mouse_wheel_up              
        then
            if
                0A4B: is_pc_using_joypad
            then
                if
                    88B7: not is_local_var_bit_set_const 10@ bit 5
                jf @Main
                if
                    00E1: is_button_pressed pad 0 button 7
                then
                    08BD: set_local_var_bit_const 10@ bit 5
                    jump @Main
                end
                0A8C: write_memory 0xB73462 size 2 value 0 virtual_protect 0    //L2 not pressed
            end
                
            :ZoomIn
            if
                88B7: not is_local_var_bit_set_const 10@ bit 1
            jf @ZoomOut2
            
            :ZoomIn2
            if
                0025: is_float_lvar_greater_than_float_lvar 1@ > 27@
            jf @SuppressRadioSwitch                        
            if
                3@ == 0.0
            then
                0087: set_lvar_float_to_lvar_float 3@ = 1@
            end
            
            0087: set_lvar_float_to_lvar_float 2@ = 1@
            if
                0025: is_float_lvar_greater_than_float_lvar 1@ > 3@
            then
                0087: set_lvar_float_to_lvar_float 31@ = 3@
                006B: mult_float_lvar_by_float_lvar 31@ *= 26@
                0063: sub_float_lvar_from_float_lvar 2@ -= 31@
                jump @ZoomApply
            end
            006B: mult_float_lvar_by_float_lvar 2@ *= 25@                        
            jump @ZoomApply 
        end              
        if or
            00E1: is_button_pressed pad 0 button 7
            0E11: is_mouse_wheel_down
        jf @Main
        if
            0A4B: is_pc_using_joypad
        then
            if
                88B7: not is_local_var_bit_set_const 10@ bit 5
            jf @Main
            0A8C: write_memory 0xB73466 size 2 value 0 virtual_protect 0    //R2 not pressed
        end
        
        :ZoomOut
        if
            88B7: not is_local_var_bit_set_const 10@ bit 1
        jf @ZoomIn2
        
        :ZoomOut2
        if
            1@ < 99.9
        jf @SuppressRadioSwitch
        if
            3@ == 0.0
        then
            0087: set_lvar_float_to_lvar_float 3@ = 1@
        end
    
        0087: set_lvar_float_to_lvar_float 2@ = 1@
        if
            0025: is_float_lvar_greater_than_float_lvar 1@ > 3@
        then
            0087: set_lvar_float_to_lvar_float 31@ = 3@
            006B: mult_float_lvar_by_float_lvar 31@ *= 26@
            005B: add_float_lvar_to_float_lvar 2@ += 31@
        else 
            0073: div_float_lvar_by_float_lvar 2@ /= 25@
        end
        
        :ZoomApply
        if
            0025: is_float_lvar_greater_than_float_lvar 27@ > 2@
        then
            0087: set_lvar_float_to_lvar_float 2@ = 27@
        end
        if
            2@ > 99.9
        then
            2@ = 99.9
        end
        if
            TIMERB < 100
        then
            0087: set_lvar_float_to_lvar_float 31@ = 2@
            0063: sub_float_lvar_from_float_lvar 31@ -= 1@
            31@ *= 0.2
            005B: add_float_lvar_to_float_lvar 1@ += 31@
        end
        0922: camera_set_lerp_fov 1@ to 2@ timelimit 100 smooth_transition 1
        0931: camera_persist_fov 1
        TIMERB = 0
        
        :SuppressRadioSwitch
        0A8C: write_memory 0xB73468 size 2 value 0x00 virtual_protect 0
        0A8C: write_memory 0xB7346A size 2 value 0x00 virtual_protect 0                                        
        jump @Main
    end                                             

    :ResetEverything
    if
        0@ == 0
    gosub_if_false @ResetApply
    if
        12@ > 0.0
    then
        0A8C: write_memory 0xB6EC1C size 4 value 12@ virtual_protect 0
        12@ = 0.0
        0ED8: set_script_event_on_menu 0 label @ResetOnMenu var_slot 14@
    end
    if
        0ADC: test_cheat "WZURELOAD"
    then
        0ACE: print_help_formatted "Weapon Zoom Unlimited settings reloading start"
        0AC7: get_var_pointer 33@ = var 0@
        0A8C: write_memory 33@ size 128 value 0x00 virtual_protect 1    //reset variables
        33@ = 424242
        jump @Initialization  
    end
end


:ResetOnMenu
if
    0@ == 0
gosub_if_false @ResetApply
if
    12@ > 0.0
then
    0A8C: write_memory 0xB6EC1C size 4 value 12@ virtual_protect 0
    12@ = 0.0
    0ED8: set_script_event_on_menu 0 label @ResetOnMenu var_slot 14@
end
return_script_event


:ResetApply
if
    08B7: is_local_var_bit_set_const 10@ bit 2
then
    :ClearHelp
    03E6: clear_help
    08C3: clear_local_var_bit_const 10@ bit 2
end   

if
    3@ > 0.0
then
    if
        0E42: is_char_doing_task_id $PLAYER_ACTOR task_id 1022  //driveby
    then
        0922: camera_set_lerp_fov 1@ to 3@ timelimit 400 smooth_transition 1
        0931: camera_persist_fov 1
    else
        0931: camera_persist_fov 0
    end
end
0@ = 0
3@ = 0.0

08C3: clear_local_var_bit_const 10@ bit 4
08C3: clear_local_var_bit_const 10@ bit 5

0AAA: 28@ = get_script_struct_named "MANDRBY"
if
    28@ > 0
then
    if
        9@ > 0
    then
        0D2E: set_script_var 28@ index 6 value 9@
    end
    if
        8@ > 0
    then
        0D2E: set_script_var 28@ index 8 value 8@
    end
end
9@ = -2
8@ = -2
if
    7@ <> -2
then
    if and
        28@ > 0
        7@ > 0
    then
        0D2E: set_script_var 28@ index 7 value 7@
    end
    if
        08B7: is_local_var_bit_set_const 10@ bit 7
    then
        08C3: clear_local_var_bit_const 10@ bit 0
        08C3: clear_local_var_bit_const 10@ bit 7
    end
    7@ = -2
end
return


:ActivationCheck
if
    0A4B: is_pc_using_joypad
then
    if
        8E3E: not is_button_just_pressed pad 0 button 23@
    jf @ManualActivation
else
    if
        0E3D: is_key_just_pressed 21@
    then
        :ManualActivation
        if or
            19@ <> 1
            08B7: is_local_var_bit_set_const 10@ bit 2
        then
            03E5: print_help 'CHEAT2'
            wait 0
        end
        if                   
            88B7: not is_local_var_bit_set_const 10@ bit 2
        jf @ClearHelp
        08BD: set_local_var_bit_const 10@ bit 2
        0@ = 1
        if
            19@ < 1
        jf @PrintMessage
        03E6: clear_help
        return
    end
end
if
    08B7: is_local_var_bit_set_const 10@ bit 2
then
    if and
        19@ > 1
        88FE: not is_help_message_being_displayed
    return_if_false
    if
        868C: not is_player_targetting_anything $PLAYER_CHAR
    return_if_false
    
    :PrintMessage
    if or
        8A4B: not is_pc_using_joypad
        88B7: not is_local_var_bit_set_const 10@ bit 0
    then
        054C: load_mission_text 'SYN1'
        if
            19@ > 1
        then
            0512: print_help_forever 'SYN1_44'
        else
            03E5: print_help 'SYN1_44'
        end
        TIMERA = 0
        
        repeat
            if
                8A2A: not is_this_help_message_being_displayed 'SYN1_44'
            jf @LinkinPark
            wait 0
        until TIMERA > 200
    end
    if
        19@ > 1
    then
        0512: print_help_forever 'CHEAT2'
    else
        03E5: print_help 'CHEAT2'
    end
    
    :LinkinPark
    if and
        0256: is_player_playing $PLAYER_CHAR
        8EB7: not is_on_scripted_cutscene
    jf @ClearHelp
    return
end
if
    0@ <> -2
return_if_false
0@ = -2                         
return                        


:ConditionCheck
0@ = -1
26@ = 0                
27@ = 0
0470: 30@ = get_current_char_weapon $PLAYER_ACTOR
if and
    8E26: not is_weapon_fire_type 30@ 0 //Melee
    8E26: not is_weapon_fire_type 30@ 5 //Use
return_if_false
0E83: get_current_char_weaponinfo $PLAYER_ACTOR store_to 29@
if
    0E26: is_weapon_fire_type 30@ 2 //Projectiles
then
    0E87: get_weaponinfo_animgroup 29@ store_to 31@
    if
        31@ <> 28   //Grenade    
    return_if_false
end
0D4E: 29@ = read_struct_offset 29@ offset 0x30 size 4   //Skill level
0EF7: clamp_int 29@ min 0 max 2 store_to 29@
0AAA: 28@ = get_script_struct_named "MANDRBY"
if
    28@ > 0
then
    0D2F: 15@ = get_script_var 28@ index 15     
    if and
        15@ > 0
        29@ < 2
    then
        29@ += 1
        0E84: get_weaponinfo 30@ skill 29@ store_to 31@
        if
            803C: not is_int_var_equal_to_int_lvar 31@ <> 15@
        then
            29@ -= 1
        end
    end
end
29@ *= 0x04
29@ += 0x04
if
    30@ < 256
jf @DefaultSetting
0A90: int_mul 31@ = 30@ * 0x10
0D4E: 25@ = read_struct_offset 16@ offset 31@ size 4
005A: add_int_lvar_to_int_lvar 31@ += 29@
0D4E: 27@ = read_struct_offset 16@ offset 31@ size 4
if and
    25@ == -2.0
    27@ == -2.0
then
    :DefaultSetting
    0D4E: 25@ = read_struct_offset 16@ offset 0x1000 size 4
    29@ += 0x1000
    0D4E: 27@ = read_struct_offset 16@ offset 29@ size 4
end
if and
    25@ > 0.0
    27@ > 0.0
    27@ < 70.0
return_if_false
if and
    27@ > 0.01
    08B7: is_local_var_bit_set_const 10@ bit 6
then
    27@ = 0.01
end
if
    25@ > 0.95
then
    25@ = 0.95
end
26@ = 1.0
0063: sub_float_lvar_from_float_lvar 26@ -= 25@
0@ = 1
return


:Buffer
hex
    00(4112)
end


:ILoveMyGirlfriendJessica
TIMERA = 0

repeat
    if
        0@ == 0
    then
        0AD1: print_formatted_now "Weapon Zoom Unlimited: CLEO+ 1.2.0 or newer required. Please download and install it in cleo folder." time 100
    else
        0AD1: print_formatted_now "Weapon Zoom Unlimited: Failed to find the .ini file. Check the file path or file name." time 100
    end
    wait 0
    if or
        89E7: not is_player_control_on $PLAYER_CHAR
        016B: fading
    then
        TIMERA = 0
    end
until TIMERA > 8000 

0A93: terminate_this_custom_script